Is there a way to get the G Code current line that's being executed? Right now it seems to point to several lines ahead and seems like it's based on the TPLookahead value.
Thanks,
Kevin
Group: DynoMotion
Message: 3031
From: Tom Kerekes
Date: 1/10/2012
Subject: Re: True G Code Current Line
Hi Kevin,
Not easily. The Interpreter works ahead to allow for Trajectory Planning and data buffering in KFLOP. This might be hundreds of lines of GCode ahead in some cases. The PC doesn't really know what KFLOP is currently executing. The ExecTime command can be used to ask how much Time has been executed from the Coordinated Motion Buffer. Using this time one can work backwards through the TragectoryPlanner's Segment queue to find the current segment that includes that time. That segment contains a Sequence Number which is the number of lines of GCode executed. Unfortunately
because of nested subroutines and so forth that isn't directly related to a GCode File line number. There is a StateTracker class that can be used to re-wind the Interpreter's state back to that Sequence Number which will then reveal the line number. This all happens when the Operator pushes "Halt" in KMotionCNC.
Regards
TK
Group: DynoMotion
Message: 3034
From: Brad Murry
Date: 1/10/2012
Subject: Re: True G Code Current Line
Hello Tom,
I was poking around the TP code a few months back and noticed your segment structs have::
int sequence_number; // GCode sequence_number associated with this segment
int ID; // GCode mechanism that generated this
Is there any way the kflop can set a persist data member with the sequence # of the currently executing segment?
(I’m sure I am waay over simplifying things here)
-Brad Murry
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of Tom Kerekes Sent: Tuesday, January 10, 2012 9:46 AM To: DynoMotion@yahoogroups.com Subject: Re: [DynoMotion] True G Code Current Line
Hi Kevin,
Not easily. The Interpreter works ahead to allow for Trajectory Planning and data buffering in KFLOP. This might be hundreds of lines of GCode ahead in some cases. The PC doesn't really know what KFLOP is currently executing. The ExecTime command can be used to ask how much Time has been executed from the Coordinated Motion Buffer. Using this time one can work backwards through the TragectoryPlanner's Segment queue to find the current segment that includes that time. That segment contains a Sequence Number which is the number of lines of GCode executed. Unfortunately because of nested subroutines and so forth that isn't directly related to a GCode File line number. There is a StateTracker class that can be used to re-wind the Interpreter's state back to that Sequence Number which will then reveal the line number. This all happens when the Operator pushes "Halt" in KMotionCNC.
Is there a way to get the G Code current line that's being executed? Right now it seems to point to several lines ahead and seems like it's based on the TPLookahead value.